#include "stdafx.h"
#include "Generator.h"

namespace MyGame {

Generator::Generator(void) {
    this->blend = 1.0f;
    this->scale = 1.0f;
}

Generator::~Generator(void) {
}

FLOAT Generator::GetBlend() const {
    return this->blend;
}

void Generator::SetBlend(FLOAT val) {
    this->blend = val;
}

FLOAT Generator::GetScale() const {
    return this->scale;
}

void Generator::SetScale(FLOAT val) {
    this->scale = val;
}

void Generator::GenerateBlend(HeightMap* heightMap) {
    HeightMap* oldMap = heightMap->Clone();
    this->Generate(heightMap);
    HeightMap::Blend(heightMap, oldMap, this->blend);
    d3d::Delete(oldMap);
}

void Generator::GenerateNormalizeBlend(HeightMap* heightMap) {
    HeightMap* oldMap = heightMap->Clone();
    this->Generate(heightMap);
    HeightMap::Normalize(heightMap, this->scale);
    HeightMap::Blend(heightMap, oldMap, this->blend);
    d3d::Delete(oldMap);
}

}